package com.ccx.library.function.source;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ccx.library.function.annotation.TimeAt;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author ccx
 * Log实体
 */
@TableName(value = "sys_log")
public class SysLog {
    /**
     * 日志Id
     */
    @TableId(value = "log_id")
    private String LogId;

    /**
     * 日志内容
     */
    private String LogInfo;

    /**
     * 操作IP
     */
    private String LogIpAddr;


    public String getLogId() {
        return LogId;
    }

    public void setLogId(String logId) {
        LogId = logId;
    }

    public String getLogInfo() {
        return LogInfo;
    }

    public void setLogInfo(String logInfo) {
        LogInfo = logInfo;
    }

    public String getLogIpAddr() {
        return LogIpAddr;
    }

    public void setLogIpAddr(String logIpAddr) {
        LogIpAddr = logIpAddr;
    }

    public String getRequestUrl() {
        return RequestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        RequestUrl = requestUrl;
    }

    @Override
    public String toString() {
        return "SysLog{" +
                "LogId='" + LogId + '\'' +
                ", LogInfo='" + LogInfo + '\'' +
                ", LogIpAddr='" + LogIpAddr + '\'' +
                ", RequestUrl='" + RequestUrl + '\'' +
                ", LogType='" + LogType + '\'' +
                ", LogModule='" + LogModule + '\'' +
                ", author='" + author + '\'' +
                ", LogTime=" + LogTime +
                '}';
    }

    public String getLogType() {
        return LogType;
    }

    public void setLogType(String logType) {
        LogType = logType;
    }

    public String getLogModule() {
        return LogModule;
    }

    public void setLogModule(String logModule) {
        LogModule = logModule;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getLogTime() {
        return LogTime;
    }

    public void setLogTime(String logTime) {
        LogTime = logTime;
    }

    public SysLog(String logId, String logInfo, String logIpAddr, String requestUrl, String logType, String logModule, String author, String logTime) {
        LogId = logId;
        LogInfo = logInfo;
        LogIpAddr = logIpAddr;
        RequestUrl = requestUrl;
        LogType = logType;
        LogModule = logModule;
        this.author = author;
        LogTime = logTime;
    }
    public SysLog(){

    }

    /**
     * 请求接口地址
     */
    private String RequestUrl;

    /**
     * 操作类型
     */
    private String LogType;

    /**
     * 操作模块
     */
    private String LogModule;

    /**
     * 操作用户
     */
    private String author;

    /**
     * 日志时间
     */
    @TimeAt
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String LogTime;
}
